import Vue from 'vue'
import Vuex from 'vuex'


import login from "./modules/login";
import tabbar from "./modules/tabbar";
import shop from "./modules/shop";
import activity from "./modules/activity";
import afterSale from "./modules/afterSale";
import integral from "./modules/integral";  //积分
import wallet from "./modules/wallet";  //余额
import coupon from "./modules/coupon";  //优惠券



Vue.use(Vuex)

const store = new Vuex.Store({
    modules: {
        login,
        tabbar,
        shop,
        activity,
        afterSale,
        integral,   //积分
        wallet,  //余额
        coupon  //优惠券
    },
    state: {
        buyData: {},
    },

    mutations: {
        // 购买商品参数
        saveBuyData(state, data) {
            state.buyData = data;
        }

    }
})

export default store